public class work1 {
   //力扣 :11. 盛最多水的容器
    public int maxArea(int[] height) {
        int max=0;
        int left=0;
        int right=height.length-1;
        while(left!=right){
            max=Math.max(max,(right-left)*(Math.min(height[left],height[right])));
            if(height[left]<=height[right]){
                left++;
            }else right--;
        }
        return max;
    }
}
